package com.selangshiwo.sina.requst;

import java.util.Date;

/**
 * 	稍后全配置化读取
 * 
 * @author wucheng
 *
 */
public enum REQUEST_URL {
	
	PRELOGIN("http://login.sina.com.cn/sso/prelogin.php"),
	SSOLOGIN("http://login.sina.com.cn/sso/login.php"),
	WEIBOSENDMSG("http://weibo.com/aj/mblog/add");
	
	private String url = "";
	private final String SSOVersion = "ssologin.js(v1.3.14)";	
	
	private REQUEST_URL(String val){
		this.url = val ;
	}
	
	public String toStringWithTS(){
		String outUrl = this.url;
		if(outUrl.indexOf("?") > 0)	
			outUrl += "&";
		else
			outUrl += "?";
		
		outUrl += "__rnd=" + new Date().getTime();
		
		return outUrl ;
	}
	
	public String toStringWithVersion(){
		String outUrl = this.url;
		if(outUrl.indexOf("?") > 0)	
			outUrl += "&";
		else
			outUrl += "?";
		
		outUrl += "client=" + this.SSOVersion ;
		
		return outUrl ;
		
	}
	
	public String toString(){
		return this.url ;
	}
	
}
